package com.renting.common.entity;

import com.alibaba.fastjson.JSONObject;
import com.renting.modules.sys.entity.User;
import org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties;
import org.springframework.data.repository.NoRepositoryBean;

import java.util.Date;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
public class BaseEntity extends PageParam {
    @Id
    private String id;//标示id
    private Date createTime;//创建时间
    private Date updateTime;//更新时间
    private String name;//实体名
    private String remark;//备注
    private String isDelete;//是否删除

    @ManyToOne
    @JoinColumn(name = "create_person", referencedColumnName = "id")
    private User createPerson;
    @ManyToOne
    @JoinColumn(name = "update_person", referencedColumnName = "id")
    private User updatePerson;

    public User getCreatePerson() {
        return createPerson;
    }

    public void setCreatePerson(User createPerson) {
        this.createPerson = createPerson;
    }

    public User getUpdatePerson() {
        return updatePerson;
    }

    public void setUpdatePerson(User updatePerson) {
        this.updatePerson = updatePerson;
    }

    public String getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(String isDelete) {
        this.isDelete = isDelete;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BaseEntity() {
        super();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String toJsonString() {
        return JSONObject.toJSONString(this);
    }

}
